3D plots (meshes)
PlantGeom uses Makie.jl to make 3d mesh plots. It also uses MeshViz.jl that is also based on Makie.
This way the plots you make using PlantGeom support all the nice possibilities offered by Makie, such as making sub-plots, interactive plots...
Interactive plot
Here comes the fun part! We can make 3D representations of the plants based on the geometry of each of its nodes.
If you read your MTG from an OPF file, the 3D geometry should already be computed, so you just have to viz() the MTG.
Because we're plotting the interactive plot in the webpage, we must use JSServe first (no need when using Julia from the REPL or VS Code):
using JSServe
Page(exportable=true, offline=true)Then we can plot our interactive 3D plant:
using PlantGeom, WGLMakie
mtg = read_opf(joinpath(dirname(dirname(pathof(PlantGeom))),"test","files","simple_plant.opf"))
viz(mtg)